package com.tangyuan.video.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tangyuan.common.result.Result;
import com.tangyuan.dto.GivingGiftDto;
import com.tangyuan.model.VideoGift;
import com.tangyuan.model.VideoGiftRecord;
import com.tangyuan.common.util.CommStatus;
import com.tangyuan.video.service.IVideoGiftRecordService;
import com.tangyuan.video.service.IVideoGiftService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @Description: video_gift
 * @Author: jeecg-boot
 * @Date: 2024-03-12
 * @Version: V1.0
 */
@RestController
@RequestMapping("/video/videoGift")
@Slf4j
public class VideoGiftController {
    @Autowired
    private IVideoGiftService videoGiftService;


    /**
     * 获取礼物列表
     *
     * @return
     */
    @GetMapping("/getGiftList")
    public Result getGiftList(@RequestHeader(name = "userId",required = false) Long userId) {
        return videoGiftService.getGiftList(userId);
    }



    /**
     * 用户赠送礼物
     *
     * @param givingGiftDto
     * @return
     */
    @PostMapping("/givingGift")
    public Result givingGift(@RequestHeader(name = "userId",required = false) Long userId, @RequestBody GivingGiftDto givingGiftDto) {
        return videoGiftService.givingGift(givingGiftDto,userId);
    }
}
